/*    */ package com.zimbra.cs.mime;
/*    */ 
/*    */ import com.zimbra.common.util.ByteUtil;
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import java.io.IOException;
/*    */ import java.io.PipedOutputStream;
/*    */ import javax.mail.MessagingException;
/*    */ import javax.mail.internet.MimeMessage;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class MimeMessageOutputThread
/*    */   implements Runnable
/*    */ {
/*    */   private PipedOutputStream mOut;
/*    */   private MimeMessage mMsg;
/*    */   
/*    */   MimeMessageOutputThread(MimeMessage msg, PipedOutputStream out)
/*    */   {
/* 40 */     if (msg == null) {
/* 41 */       throw new NullPointerException("msg cannot be null");
/*    */     }
/* 43 */     if (out == null) {
/* 44 */       throw new NullPointerException("out cannot be null");
/*    */     }
/* 46 */     this.mMsg = msg;
/* 47 */     this.mOut = out;
/*    */   }
/*    */   
/*    */   public void run() {
/*    */     try {
/* 52 */       this.mMsg.writeTo(this.mOut);
/*    */     } catch (IOException e) {
/* 54 */       ZimbraLog.misc.warn("Unable to write MimeMessage to output stream.", e);
/*    */     } catch (MessagingException e) {
/* 56 */       ZimbraLog.misc.warn("Unable to write MimeMessage to output stream.", e);
/*    */     } catch (Throwable t) {
/* 58 */       ZimbraLog.misc.warn("Unable to write MimeMessage to output stream.", t);
/*    */     } finally {
/* 60 */       ByteUtil.closeStream(this.mOut);
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/mime/MimeMessageOutputThread.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */